const { router, libQuery } = require('../../lib/route')

libQuery((req, res, next, method) => {
  const dataPath = '../datas/search.js'
  const data = require(dataPath)
  if (data) {
    setTimeout(() => {
      res.send(JSON.stringify(data))
    }, 1400);
  } else {
    res.renderError('没有找到 ' + dataPath)
  }
}, '/search')

module.exports = router;
